<template>
	<!-- 商品列表 -->
	<view class="goodsBox">
		<view class="goodsList">
			<view class="goods-wrapper">
				<view class="initNoData" v-if="goodsDataList.length == 0"></view>
				<scroll-view scroll-y="true" v-else>
					<custom-waterfalls-flow :value="goodsDataList" @imageClick="imageClick">
						<template v-slot:default="item">
						<view class="goods-item" :class="{'goods-item--padding' : item.integral == 2}"
						@tap.stop="$tools.jump('/pages/goods/goodsDetails',item.id)">
								<!-- <image class="goods-item__img" :src="'../../static/index/goods-1.png'" mode="aspectFill"></image> -->
								<!-- <image class="goods-item__img" :src="item.image" mode="aspectFill"></image> -->
								<view class="goods-item__giveIntegral" v-if="item.integral == 2">自营</view>
								<view class="goods-item__title">
									{{ item.storeName }}
								</view>	
								<view class="goods-item__tipsBox" v-if="Number(item.giveIntegral) > 0">
									赠送：{{ item.giveIntegral }}积分
								</view>
								<view class="goods-item__optBox">
									<view class="goods-item__priceBox">
										<view class="goods-item__priceBox-price">{{ item.price }}</view>
									</view>
									<view class="goods-item__sales">销量：{{ item.totalSales }}</view>
								</view>
							</view>
						</template>
					</custom-waterfalls-flow>
					<!-- <view class="goods-item" v-for="(item,index) in goodsDataList" :key="index" 
					@tap.stop="$tools.jump('/pages/goods/goodsDetails',item.id)">
						<image class="goods-item__img" :src="item.image" mode="aspectFill"></image>
						<view class="goods-item__title">
							{{ item.storeName }}
						</view>	
						<view class="goods-item__tipsBox" v-if="Number(item.giveIntegral) > 0">
							赠送：{{ item.giveIntegral }}绿色消费券
						</view>
						<view class="goods-item__optBox">
							<view class="goods-item__priceBox">
								<view class="goods-item__priceBox-price">{{ item.price }}</view>
								<view class="goods-item__priceBox-noPrice">¥{{ item.otPrice }}</view>
							</view>
							<view class="goods-item__sales">销量：{{ item.sales }}</view>
						</view>
					</view> -->
				</scroll-view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "",
		props: {
			goodsDataList: {
				type: Array,
				default: function() {
					return []
				},
			},
			rank: {
			    type: [Number, String],
			    default: 0,
			},
			showPower: {
				type: Boolean,
				default:false,
			}
		},
		data() {
			return {
				qiniu: {},
			}
		},
		mounted() {
			// this.getQiNiuToken();
		},
		created() {
			
		},
		methods: {
			imageClick(item){
				console.log("item:",item);
				this.$tools.jump('/pages/goods/goodsDetails',item.id);
			},
			// 查询七牛云上传文件TOKEN
			getQiNiuToken() {
				var data = {};
				this.$Ajax('/userinfo/qiniu/token',data, res => {
						this.qiniu = res.data;
					}, err => {
						
					},'GET'
				);
			},
		},
	}	
</script>

<style lang="scss" scoped>
	
</style>